.class public Lcom/brixd/niceapp/model/CommonUserModel;
.super Ljava/lang/Object;
.source "CommonUserModel.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final serialVersionUID:J = 0x4c370ea2ee26df9cL


# instance fields
.field private avatarUrl:Ljava/lang/String;

.field private bgColor:Ljava/lang/String;

.field private gender:Ljava/lang/String;

.field private userId:I

.field private userIdentity:I

.field private userIntro:Ljava/lang/String;

.field private userName:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 21
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public constructor <init>(Lcom/brixd/niceapp/model/UserModel;)V
    .registers 3
    .param p1, "model"    # Lcom/brixd/niceapp/model/UserModel;

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 24
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/UserModel;->getUid()I

    move-result v0

    iput v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userId:I

    .line 25
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/UserModel;->getNick()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userName:Ljava/lang/String;

    .line 26
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/UserModel;->getDescription()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userIntro:Ljava/lang/String;

    .line 27
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/UserModel;->getImage()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->avatarUrl:Ljava/lang/String;

    .line 28
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/UserModel;->getGender()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->gender:Ljava/lang/String;

    .line 29
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/UserModel;->getBgColor()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->bgColor:Ljava/lang/String;

    .line 30
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/UserModel;->getUserIdentity()I

    move-result v0

    iput v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userIdentity:I

    .line 31
    return-void
.end method

.method public static parseUserModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/CommonUserModel;
    .registers 4
    .param p0, "userJson"    # Lorg/json/JSONObject;

    .prologue
    .line 116
    if-nez p0, :cond_4

    .line 117
    const/4 v1, 0x0

    .line 135
    :goto_3
    return-object v1

    .line 122
    :cond_4
    :try_start_4
    new-instance v1, Lcom/brixd/niceapp/model/CommonUserModel;

    invoke-direct {v1}, Lcom/brixd/niceapp/model/CommonUserModel;-><init>()V

    .line 123
    .local v1, "user":Lcom/brixd/niceapp/model/CommonUserModel;
    const-string v2, "id"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/CommonUserModel;->setUserId(I)V

    .line 124
    const-string v2, "userName"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/CommonUserModel;->setUserName(Ljava/lang/String;)V

    .line 125
    const-string v2, "avatar_url"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/CommonUserModel;->setAvatarUrl(Ljava/lang/String;)V

    .line 126
    const-string v2, "career"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/CommonUserModel;->setUserIntro(Ljava/lang/String;)V

    .line 127
    const-string v2, "gender"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/CommonUserModel;->setGender(Ljava/lang/String;)V

    .line 128
    const-string v2, "bg_color"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/CommonUserModel;->setBgColor(Ljava/lang/String;)V

    .line 129
    const-string v2, "identity"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/CommonUserModel;->setUserIdentity(I)V
    :try_end_48
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_48} :catch_49

    goto :goto_3

    .line 130
    .end local v1    # "user":Lcom/brixd/niceapp/model/CommonUserModel;
    :catch_49
    move-exception v0

    .line 131
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 132
    const/4 v1, 0x0

    .restart local v1    # "user":Lcom/brixd/niceapp/model/CommonUserModel;
    goto :goto_3
.end method

.method public static parseUserModels(Lorg/json/JSONArray;)Ljava/util/ArrayList;
    .registers 6
    .param p0, "users"    # Lorg/json/JSONArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONArray;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CommonUserModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 90
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 92
    .local v0, "estimateUsers":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/model/CommonUserModel;>;"
    if-eqz p0, :cond_1e

    .line 93
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_8
    invoke-virtual {p0}, Lorg/json/JSONArray;->length()I

    move-result v4

    if-ge v1, v4, :cond_1e

    .line 94
    invoke-virtual {p0, v1}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v3

    .line 95
    .local v3, "userJson":Lorg/json/JSONObject;
    invoke-static {v3}, Lcom/brixd/niceapp/model/CommonUserModel;->parseUserModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v2

    .line 106
    .local v2, "model":Lcom/brixd/niceapp/model/CommonUserModel;
    if-eqz v2, :cond_1b

    .line 107
    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 93
    :cond_1b
    add-int/lit8 v1, v1, 0x1

    goto :goto_8

    .line 112
    .end local v1    # "i":I
    .end local v2    # "model":Lcom/brixd/niceapp/model/CommonUserModel;
    .end local v3    # "userJson":Lorg/json/JSONObject;
    :cond_1e
    return-object v0
.end method


# virtual methods
.method public getAvatarUrl()Ljava/lang/String;
    .registers 2

    .prologue
    .line 58
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->avatarUrl:Ljava/lang/String;

    return-object v0
.end method

.method public getBgColor()Ljava/lang/String;
    .registers 2

    .prologue
    .line 74
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->bgColor:Ljava/lang/String;

    return-object v0
.end method

.method public getGender()Ljava/lang/String;
    .registers 2

    .prologue
    .line 66
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->gender:Ljava/lang/String;

    return-object v0
.end method

.method public getUserId()I
    .registers 2

    .prologue
    .line 34
    iget v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userId:I

    return v0
.end method

.method public getUserIdentity()I
    .registers 2

    .prologue
    .line 82
    iget v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userIdentity:I

    return v0
.end method

.method public getUserIntro()Ljava/lang/String;
    .registers 2

    .prologue
    .line 50
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userIntro:Ljava/lang/String;

    return-object v0
.end method

.method public getUserName()Ljava/lang/String;
    .registers 2

    .prologue
    .line 42
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userName:Ljava/lang/String;

    return-object v0
.end method

.method public setAvatarUrl(Ljava/lang/String;)V
    .registers 2
    .param p1, "avatarUrl"    # Ljava/lang/String;

    .prologue
    .line 62
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommonUserModel;->avatarUrl:Ljava/lang/String;

    .line 63
    return-void
.end method

.method public setBgColor(Ljava/lang/String;)V
    .registers 2
    .param p1, "bgColor"    # Ljava/lang/String;

    .prologue
    .line 78
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommonUserModel;->bgColor:Ljava/lang/String;

    .line 79
    return-void
.end method

.method public setGender(Ljava/lang/String;)V
    .registers 2
    .param p1, "gender"    # Ljava/lang/String;

    .prologue
    .line 70
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommonUserModel;->gender:Ljava/lang/String;

    .line 71
    return-void
.end method

.method public setUserId(I)V
    .registers 2
    .param p1, "userId"    # I

    .prologue
    .line 38
    iput p1, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userId:I

    .line 39
    return-void
.end method

.method public setUserIdentity(I)V
    .registers 2
    .param p1, "userIdentity"    # I

    .prologue
    .line 86
    iput p1, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userIdentity:I

    .line 87
    return-void
.end method

.method public setUserIntro(Ljava/lang/String;)V
    .registers 2
    .param p1, "userIntro"    # Ljava/lang/String;

    .prologue
    .line 54
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userIntro:Ljava/lang/String;

    .line 55
    return-void
.end method

.method public setUserName(Ljava/lang/String;)V
    .registers 2
    .param p1, "userName"    # Ljava/lang/String;

    .prologue
    .line 46
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommonUserModel;->userName:Ljava/lang/String;

    .line 47
    return-void
.end method
